package com.copro.chemdb.ques;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.struts.action.ActionForm;

public class Questionnaire extends ActionForm {

	private static final long serialVersionUID = 6390193780742938939L;

	public Questionnaire() {
	}

	public Questionnaire(ResultSet rs) throws SQLException {
		this();
		this.id = rs.getInt("id");
		this.name = rs.getString("name");
		this.dbName = rs.getString("dbName");
		this.parentId = rs.getInt("id_T_questionnaire");
		this.keySubjectId = rs.getInt("keySubjectId");
	}

	private int id;
	private String name;
	private String dbName;
	private int parentId;
	private int keySubjectId;

	public String getDbName() {
		return dbName;
	}

	public void setDbName(String dbName) {
		this.dbName = dbName;
	}

	public int getKeySubjectId() {
		return keySubjectId;
	}

	public void setKeySubjectId(int keySubjectId) {
		this.keySubjectId = keySubjectId;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	public boolean isRoot() {
		return this.parentId <= 0;
	}

}
